package editor.osx;

import adventure.commands.skills.ConjureItem;
import adventure.commands.skills.SkillEdit;
import adventure.commands.skills.SkillManager;
import adventure.placeable.PlaceableManagerEdit;
import adventure.vocation.Vocation;
import java.text.NumberFormat;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;

/**
 *
 * @author Michael Hanns
 * 
 */
public class DialogAddSkillView extends javax.swing.JDialog {

    private static final long serialVersionUID = -1522782237246166517L;
    private SkillManager skills;
    private int totalSkills;
    private PlaceableManagerEdit placeables;
    private WITNAFrameView parentFrame;
    private EditorVocationView parentDialog;
    private Vocation voc;
    private int[][] itemsNeeded;

    /** Creates new form EditorItemView */
    public DialogAddSkillView(WITNAFrameView parent, EditorVocationView parentD,
            SkillManager s, PlaceableManagerEdit p, Vocation v) {
        super(parent, true);
        this.parentFrame = parent;
        this.parentDialog = parentD;
        skills = s;
        placeables = p;
        voc = v;
        initComponents();
        fillTable();
        getSkillData(totalSkills - 1);
    }

    public void fillTable() {
        skillListTable.removeAll();

        int x = 1;
        while (((SkillEdit) skills.getSkill(x)).getID() != 0) {
            skillListTable.getModel().setValueAt(((SkillEdit) skills.getSkill(x)).getID(), x - 1, 0);
            skillListTable.getModel().setValueAt(((SkillEdit) skills.getSkill(x)).getName(), x - 1, 1);
            x++;
        }

        totalSkills = x;

        skillListTable.changeSelection(x - 1, 2, false, false);
    }
    
    private void selectSkill(int row) {
        if (skillListTable.getModel().getValueAt(row, 0) != null) {
            int id = parseInt(skillListTable.getModel().getValueAt(row, 0).toString());
            getSkillData(id);
        }
    }

    private void setOutput(int id) {
        SkillEdit skill = (SkillEdit) skills.getSkill(id);
        attackFlagCombo.setSelectedIndex(skill.getAttackFlag());
        attackDescBox.setText(skill.getAttackDesc());
        String[] statFlag = {"ATK", "DEF", "INT", "SPD", "LCK"};

        if (skill.getType().equalsIgnoreCase("DAMAGETARGET")) {
            if (skill.getNumDice() > 0) {
                damageBox.setText("<target> for <" + skill.getNumDice() + "d"
                        + skill.getDiceSides() + "+" + statFlag[skill.getMainStat()]
                        + "> damage.");
            } else {
                damageBox.setText("<target> for <LVLd"
                        + skill.getDiceSides() + "+" + statFlag[skill.getMainStat()]
                        + "> damage.");
            }
        } else if (skill.getType().equalsIgnoreCase("HEALTARGET")) {
            if (skill.getNumDice() > 0) {
                damageBox.setText("<target> by <" + skill.getNumDice() + "d"
                        + skill.getDiceSides() + "+" + statFlag[skill.getMainStat()]
                        + "> damage.");
            } else {
                damageBox.setText("<target> by <LVLd"
                        + skill.getDiceSides() + "+" + statFlag[skill.getMainStat()]
                        + "> damage.");
            }
        } else if (skill.getType().equalsIgnoreCase("CONJUREITEM")) {
            damageBox.setText(placeables.getItem(parseInt(itemIDBox.getText())).getName()
                    + "!");
        }
    }

    public void getSkillData(int row) {
        if (row > 0) {
            final SkillEdit skillEntry = (SkillEdit) skills.getSkill(row);
            idBox.setText(skillEntry.getID() + "");
            nameBox.setText(skillEntry.getName());
            descriptionBox.setText(skillEntry.getDescription());

            categoryCombo.setModel(new DefaultComboBoxModel(skills.getCategories()));
            categoryCombo.setSelectedItem(skillEntry.getCategory());

            // Synonyms
            String[] synonyms = skillEntry.getSynonyms();
            if (synonyms.length > 2) {
                String out = synonyms[1];
                for (int x = 2; x < synonyms.length; x++) {
                    out += "\n" + synonyms[x];
                }
                synonymsBox.setText(out);
            } else if (synonyms.length == 2) {
                synonymsBox.setText(synonyms[1]);
            } else {
                synonymsBox.setText("");
            }

            // Main stat
            affilStatCombo.setSelectedIndex(skillEntry.getMainStat());
            lvlLearnedBox.setText(skillEntry.levelLearned() + "");
            spCostBox.setText(skillEntry.getSpecialReq() + "");
            cooldownBox.setText(skillEntry.getCooldown() + "");
            notInCombatBox.setSelected(skillEntry.requiresConcentration());
            difficultyBox.setText(skillEntry.getDifficulty() + "");
            dicePerLvlBox.setSelected(skillEntry.isDicePerLevel());
            totalDiceBox.setText(skillEntry.getNumDice() + "");
            sidesPerDiceBox.setText(skillEntry.getDiceSides() + "");
            attackFlagCombo.setSelectedIndex(skillEntry.getAttackFlag());
            attackDescBox.setText(skillEntry.getAttackDesc());

            // Item prereqs
            itemsNeeded = new int[skillEntry.getItemsNeeded().length][2];
            for (int c = 0; c < itemsNeeded.length; c++) {
                itemsNeeded[c][0] = skillEntry.getItemsNeeded()[c][0];
                itemsNeeded[c][1] = skillEntry.getItemsNeeded()[c][1];
            }
            updateItemsNeededList();

            if (skillEntry.getType().equalsIgnoreCase("DAMAGETARGET")) {
                skillTypeCombo.setSelectedIndex(0);
                itemIDBox.setEnabled(false);
                itemSpawnCombo.setEnabled(false);
                dicePerLvlBox.setEnabled(true);
                totalDiceBox.setEnabled(true);
                sidesPerDiceBox.setEnabled(true);
            } else if (skillEntry.getType().equalsIgnoreCase("HEALTARGET")) {
                skillTypeCombo.setSelectedIndex(1);
                itemIDBox.setEnabled(false);
                itemSpawnCombo.setEnabled(false);
                dicePerLvlBox.setEnabled(true);
                totalDiceBox.setEnabled(true);
                sidesPerDiceBox.setEnabled(true);
            } else if (skillEntry.getType().equalsIgnoreCase("CONJUREITEM")) {
                skillTypeCombo.setSelectedIndex(2);
                itemIDBox.setEnabled(true);
                itemIDBox.setText(((ConjureItem) skillEntry).getItemID() + "");
                itemSpawnCombo.setEnabled(true);
                if (((ConjureItem) skillEntry).onFloor()) {
                    itemSpawnCombo.setSelectedIndex(1);
                } else {
                    itemSpawnCombo.setSelectedIndex(0);
                }
                dicePerLvlBox.setEnabled(false);
                totalDiceBox.setEnabled(false);
                sidesPerDiceBox.setEnabled(false);
            } else {
                itemIDBox.setEnabled(false);
                itemSpawnCombo.setEnabled(false);
                dicePerLvlBox.setEnabled(true);
                totalDiceBox.setEnabled(true);
                sidesPerDiceBox.setEnabled(true);
            }

            if (dicePerLvlBox.isEnabled() && dicePerLvlBox.isSelected()) {
                totalDiceBox.setEnabled(false);
            }

            setOutput(skillEntry.getID());
        }
    }
    
    private void updateItemsNeededList() {
        String[] itemPreReqs = new String[itemsNeeded.length];
        for (int c = 0; c < itemsNeeded.length; c++) {
            itemPreReqs[c] = itemsNeeded[c][0] + ":"
                    + placeables.getItem(itemsNeeded[c][0]).getName()
                    + " (x" + itemsNeeded[c][1] + ")";
        }
        DefaultListModel itemPreReqModel = new DefaultListModel();
        for (int c = 0; c < itemPreReqs.length; c++) {
            itemPreReqModel.add(c, itemPreReqs[c]);
        }
        itemPrereqList.setModel(itemPreReqModel);
    }

    private int parseInt(String text) {
        try {
            int i = Integer.parseInt(text);
            return i;
        } catch (NumberFormatException e) {
            return 0;
        }
    }
    
    private void addSkillToVocation(int id) {
        String name = nameBox.getText();

        if (id > 0 && name.length() > 0) {
            voc.learnSkill(skills.getSkill(id));
            parentFrame.printToConsole("Skill " + name + " added to vocation "
                    + voc.getName() + ".");
            parentFrame.setUnsavedChanges(true);
            parentDialog.getVocationData(voc.getID());
        } else {
            parentFrame.printToConsole("You must specify a name for the skill before adding to a vocation!");
        }     
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jFormattedTextField1 = new javax.swing.JFormattedTextField();
        jTextField1 = new javax.swing.JTextField();
        itemListPane = new javax.swing.JScrollPane();
        skillListTable = new javax.swing.JTable();
        closeButton = new javax.swing.JButton();
        addButton = new javax.swing.JButton();
        nameBox = new javax.swing.JFormattedTextField();
        prereqItemsPanel = new javax.swing.JPanel();
        itemsScrollPane = new javax.swing.JScrollPane();
        itemPrereqList = new javax.swing.JList();
        synonymsLabel = new javax.swing.JLabel();
        descriptionLabel = new javax.swing.JLabel();
        typePanel = new javax.swing.JPanel();
        skillTypeCombo = new javax.swing.JComboBox();
        affilStatLabel = new javax.swing.JLabel();
        affilStatCombo = new javax.swing.JComboBox();
        typeLabel = new javax.swing.JLabel();
        descScrollPane1 = new javax.swing.JScrollPane();
        descriptionBox = new javax.swing.JTextPane();
        idLabel = new javax.swing.JLabel();
        itemProduced = new javax.swing.JPanel();
        itemIdLabel = new javax.swing.JLabel();
        itemIDBox = new javax.swing.JFormattedTextField();
        itemSpawnLabel = new javax.swing.JLabel();
        itemSpawnCombo = new javax.swing.JComboBox();
        successPanel = new javax.swing.JPanel();
        totalDiceLabel1 = new javax.swing.JLabel();
        difficultyBox = new javax.swing.JFormattedTextField();
        dicePerLvlBox = new javax.swing.JCheckBox();
        dicePerLabel = new javax.swing.JLabel();
        totalDiceLabel = new javax.swing.JLabel();
        totalDiceBox = new javax.swing.JFormattedTextField();
        sidesPerDiceBox = new javax.swing.JFormattedTextField();
        sidesDiceLabel = new javax.swing.JLabel();
        notInCombatBox = new javax.swing.JCheckBox();
        notInCombatLabel = new javax.swing.JLabel();
        nameLabel = new javax.swing.JLabel();
        outputPanel = new javax.swing.JPanel();
        attackFlagCombo = new javax.swing.JComboBox();
        damageBox = new javax.swing.JFormattedTextField();
        attackDescBox = new javax.swing.JTextField();
        synsScrollPane = new javax.swing.JScrollPane();
        synonymsBox = new javax.swing.JTextArea();
        categoryLabel = new javax.swing.JLabel();
        prereqPanel = new javax.swing.JPanel();
        lvlLearnedLabel = new javax.swing.JLabel();
        lvlLearnedBox = new javax.swing.JFormattedTextField();
        spCostLabel = new javax.swing.JLabel();
        spCostBox = new javax.swing.JFormattedTextField();
        cooldownBox = new javax.swing.JFormattedTextField();
        cooldownLabel = new javax.swing.JLabel();
        categoryCombo = new javax.swing.JComboBox();
        idBox = new javax.swing.JFormattedTextField(NumberFormat.getInstance());

        jList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane2.setViewportView(jList1);

        jFormattedTextField1.setText("jFormattedTextField1");

        jTextField1.setText("jTextField1");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Add Skill");
        setLocationByPlatform(true);
        setResizable(false);

        skillListTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "#", "Name"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        skillListTable.setToolTipText("Skill list");
        skillListTable.setColumnSelectionAllowed(true);
        skillListTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        skillListTable.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                skillListTableMouseClicked(evt);
            }
        });
        itemListPane.setViewportView(skillListTable);
        skillListTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        skillListTable.getColumnModel().getColumn(0).setMinWidth(10);
        skillListTable.getColumnModel().getColumn(0).setPreferredWidth(25);
        skillListTable.getColumnModel().getColumn(0).setMaxWidth(25);

        closeButton.setText("Close");
        closeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeButtonActionPerformed(evt);
            }
        });

        addButton.setText("Add to " + voc.getName());
        addButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addButtonActionPerformed(evt);
            }
        });

        nameBox.setEditable(false);
        nameBox.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        nameBox.setToolTipText("Skill name");

        prereqItemsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Prerequisites (Items):"));

        itemsScrollPane.setMaximumSize(new java.awt.Dimension(181, 140));
        itemsScrollPane.setMinimumSize(new java.awt.Dimension(181, 140));
        itemsScrollPane.setPreferredSize(new java.awt.Dimension(181, 140));

        itemPrereqList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        itemPrereqList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        itemsScrollPane.setViewportView(itemPrereqList);

        javax.swing.GroupLayout prereqItemsPanelLayout = new javax.swing.GroupLayout(prereqItemsPanel);
        prereqItemsPanel.setLayout(prereqItemsPanelLayout);
        prereqItemsPanelLayout.setHorizontalGroup(
            prereqItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(prereqItemsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(itemsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        prereqItemsPanelLayout.setVerticalGroup(
            prereqItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(prereqItemsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(itemsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addContainerGap())
        );

        synonymsLabel.setText("Synonyms:");

        descriptionLabel.setText("Description:");

        typePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Skill:"));

        skillTypeCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Damage Target", "Heal Target", "Conjure Item" }));

        affilStatLabel.setText("Affiliated Stat:");

        affilStatCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Attack", "Defence", "Intelligence", "Speed", "Luck" }));

        typeLabel.setText("Type:");

        javax.swing.GroupLayout typePanelLayout = new javax.swing.GroupLayout(typePanel);
        typePanel.setLayout(typePanelLayout);
        typePanelLayout.setHorizontalGroup(
            typePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(skillTypeCombo, 0, 152, Short.MAX_VALUE)
            .addComponent(affilStatCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(typePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(typePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(typeLabel)
                    .addComponent(affilStatLabel))
                .addContainerGap())
        );
        typePanelLayout.setVerticalGroup(
            typePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(typePanelLayout.createSequentialGroup()
                .addGap(3, 3, 3)
                .addComponent(typeLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(skillTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(affilStatLabel)
                .addGap(4, 4, 4)
                .addComponent(affilStatCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        descriptionBox.setEditable(false);
        descriptionBox.setToolTipText("Skill description");
        descScrollPane1.setViewportView(descriptionBox);

        idLabel.setText("ID:");

        itemProduced.setBorder(javax.swing.BorderFactory.createTitledBorder("Item Conjured:"));

        itemIdLabel.setText("Item ID:");

        itemIDBox.setEditable(false);
        itemIDBox.setText("55");

        itemSpawnLabel.setText("Item spawns:");

        itemSpawnCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Inventory", "Room" }));

        javax.swing.GroupLayout itemProducedLayout = new javax.swing.GroupLayout(itemProduced);
        itemProduced.setLayout(itemProducedLayout);
        itemProducedLayout.setHorizontalGroup(
            itemProducedLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(itemProducedLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(itemIdLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(itemIDBox, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(itemSpawnLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(itemSpawnCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        itemProducedLayout.setVerticalGroup(
            itemProducedLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(itemProducedLayout.createSequentialGroup()
                .addGroup(itemProducedLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(itemIdLabel)
                    .addComponent(itemIDBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(itemSpawnLabel)
                    .addComponent(itemSpawnCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 6, Short.MAX_VALUE))
        );

        successPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Success/Effectiveness:"));

        totalDiceLabel1.setText("Difficulty:");

        difficultyBox.setEditable(false);
        difficultyBox.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));

        dicePerLabel.setText("One per level:");

        totalDiceLabel.setText("Total dice:");

        totalDiceBox.setEditable(false);
        totalDiceBox.setText("55");

        sidesPerDiceBox.setEditable(false);
        sidesPerDiceBox.setText("55");

        sidesDiceLabel.setText("Sides/dice:");

        notInCombatLabel.setText("Not in combat:");

        javax.swing.GroupLayout successPanelLayout = new javax.swing.GroupLayout(successPanel);
        successPanel.setLayout(successPanelLayout);
        successPanelLayout.setHorizontalGroup(
            successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(successPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(sidesDiceLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                    .addComponent(totalDiceLabel)
                    .addComponent(totalDiceLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(totalDiceBox, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
                    .addComponent(sidesPerDiceBox)
                    .addComponent(difficultyBox))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(dicePerLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(notInCombatLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(8, 8, 8)
                .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(notInCombatBox)
                    .addComponent(dicePerLvlBox, javax.swing.GroupLayout.Alignment.TRAILING)))
        );
        successPanelLayout.setVerticalGroup(
            successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(successPanelLayout.createSequentialGroup()
                .addGap(3, 3, 3)
                .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(totalDiceLabel1)
                        .addComponent(difficultyBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(notInCombatLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(notInCombatBox, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(totalDiceLabel)
                        .addComponent(totalDiceBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(dicePerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(dicePerLvlBox, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(successPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(sidesPerDiceBox)
                    .addComponent(sidesDiceLabel)))
        );

        nameLabel.setText("Name:");

        outputPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Output:"));

        attackFlagCombo.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
        attackFlagCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "You", "Your", "<none>" }));

        damageBox.setEditable(false);
        damageBox.setText("<target> for 5d3+INT damage!");
        damageBox.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N

        attackDescBox.setEditable(false);
        attackDescBox.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
        attackDescBox.setText("<attack description>");

        javax.swing.GroupLayout outputPanelLayout = new javax.swing.GroupLayout(outputPanel);
        outputPanel.setLayout(outputPanelLayout);
        outputPanelLayout.setHorizontalGroup(
            outputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, outputPanelLayout.createSequentialGroup()
                .addContainerGap(9, Short.MAX_VALUE)
                .addComponent(attackFlagCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(attackDescBox, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(damageBox, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        outputPanelLayout.setVerticalGroup(
            outputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(outputPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(outputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(attackFlagCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(damageBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(attackDescBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        synsScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

        synonymsBox.setEditable(false);
        synonymsBox.setColumns(20);
        synonymsBox.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
        synonymsBox.setRows(5);
        synonymsBox.setText("separate\nwith\nnew lines");
        synsScrollPane.setViewportView(synonymsBox);

        categoryLabel.setText("Category:");

        prereqPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Prerequisites:"));

        lvlLearnedLabel.setText("Level Learned:");

        lvlLearnedBox.setEditable(false);
        lvlLearnedBox.setText("55");

        spCostLabel.setText("Special cost:");

        spCostBox.setEditable(false);
        spCostBox.setText("55");

        cooldownBox.setEditable(false);
        cooldownBox.setText("55");

        cooldownLabel.setText("Cooldown:");

        javax.swing.GroupLayout prereqPanelLayout = new javax.swing.GroupLayout(prereqPanel);
        prereqPanel.setLayout(prereqPanelLayout);
        prereqPanelLayout.setHorizontalGroup(
            prereqPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(prereqPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(prereqPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(lvlLearnedLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(spCostLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cooldownLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(prereqPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(spCostBox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lvlLearnedBox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cooldownBox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );
        prereqPanelLayout.setVerticalGroup(
            prereqPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(prereqPanelLayout.createSequentialGroup()
                .addGap(3, 3, 3)
                .addGroup(prereqPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lvlLearnedBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lvlLearnedLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(prereqPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(spCostLabel)
                    .addComponent(spCostBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(prereqPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cooldownBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cooldownLabel))
                .addGap(0, 8, Short.MAX_VALUE))
        );

        categoryCombo.setEditable(true);
        categoryCombo.setEnabled(false);

        idBox.setEditable(false);
        idBox.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        idBox.setToolTipText("Skill number");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(itemListPane, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(closeButton)
                        .addGap(0, 0, 0)
                        .addComponent(addButton)
                        .addGap(6, 6, 6))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(idLabel)
                                            .addGap(18, 18, 18))
                                        .addComponent(idBox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(nameLabel)
                                        .addComponent(nameBox, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(categoryLabel)
                                            .addGap(79, 79, 79))
                                        .addGroup(layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(categoryCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGap(11, 11, 11))))
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(synonymsLabel)
                                        .addComponent(synsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(descriptionLabel)
                                        .addComponent(descScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addContainerGap()))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(outputPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(itemProduced, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(prereqPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(typePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(successPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(prereqItemsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                                .addGap(11, 11, 11))))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(idLabel)
                            .addComponent(nameLabel)
                            .addComponent(categoryLabel))
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(nameBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(idBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(categoryCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(synonymsLabel)
                            .addComponent(descriptionLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(synsScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(descScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(successPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(typePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(prereqPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(prereqItemsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(itemProduced, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(outputPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(closeButton)
                            .addComponent(addButton)))
                    .addComponent(itemListPane))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void skillListTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_skillListTableMouseClicked
        int row = skillListTable.getSelectedRow();

        selectSkill(row);
    }//GEN-LAST:event_skillListTableMouseClicked

    private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
        dispose();
    }//GEN-LAST:event_closeButtonActionPerformed

    private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
        int id = Integer.parseInt(idBox.getText());
        
        addSkillToVocation(id);
        dispose();
    }//GEN-LAST:event_addButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addButton;
    private javax.swing.JComboBox affilStatCombo;
    private javax.swing.JLabel affilStatLabel;
    private javax.swing.JTextField attackDescBox;
    private javax.swing.JComboBox attackFlagCombo;
    private javax.swing.JComboBox categoryCombo;
    private javax.swing.JLabel categoryLabel;
    private javax.swing.JButton closeButton;
    private javax.swing.JFormattedTextField cooldownBox;
    private javax.swing.JLabel cooldownLabel;
    private javax.swing.JFormattedTextField damageBox;
    private javax.swing.JScrollPane descScrollPane1;
    private javax.swing.JTextPane descriptionBox;
    private javax.swing.JLabel descriptionLabel;
    private javax.swing.JLabel dicePerLabel;
    private javax.swing.JCheckBox dicePerLvlBox;
    private javax.swing.JFormattedTextField difficultyBox;
    private javax.swing.JFormattedTextField idBox;
    private javax.swing.JLabel idLabel;
    private javax.swing.JFormattedTextField itemIDBox;
    private javax.swing.JLabel itemIdLabel;
    private javax.swing.JScrollPane itemListPane;
    private javax.swing.JList itemPrereqList;
    private javax.swing.JPanel itemProduced;
    private javax.swing.JComboBox itemSpawnCombo;
    private javax.swing.JLabel itemSpawnLabel;
    private javax.swing.JScrollPane itemsScrollPane;
    private javax.swing.JFormattedTextField jFormattedTextField1;
    private javax.swing.JList jList1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JFormattedTextField lvlLearnedBox;
    private javax.swing.JLabel lvlLearnedLabel;
    private javax.swing.JFormattedTextField nameBox;
    private javax.swing.JLabel nameLabel;
    private javax.swing.JCheckBox notInCombatBox;
    private javax.swing.JLabel notInCombatLabel;
    private javax.swing.JPanel outputPanel;
    private javax.swing.JPanel prereqItemsPanel;
    private javax.swing.JPanel prereqPanel;
    private javax.swing.JLabel sidesDiceLabel;
    private javax.swing.JFormattedTextField sidesPerDiceBox;
    private javax.swing.JTable skillListTable;
    private javax.swing.JComboBox skillTypeCombo;
    private javax.swing.JFormattedTextField spCostBox;
    private javax.swing.JLabel spCostLabel;
    private javax.swing.JPanel successPanel;
    private javax.swing.JTextArea synonymsBox;
    private javax.swing.JLabel synonymsLabel;
    private javax.swing.JScrollPane synsScrollPane;
    private javax.swing.JFormattedTextField totalDiceBox;
    private javax.swing.JLabel totalDiceLabel;
    private javax.swing.JLabel totalDiceLabel1;
    private javax.swing.JLabel typeLabel;
    private javax.swing.JPanel typePanel;
    // End of variables declaration//GEN-END:variables
}
